home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 May (DVD) / Macworld Resource DVD May 2003.toast / Data / Software / Bonus / Database / mysql-max-3.23.55.sit / mysql-max-3.23.55-apple-darwi.1 / mysql-test / t / limit.test < prev    next >
Encoding:
Text File  |  2003-01-21  |  736 b   |  31 lines  |  [TEXT/ttxt]

  1. #
  2. # Test of update and delete with limit
  3. #
  4.  
  5. drop table if exists t1;
  6. create table t1 (a int primary key, b int not null);
  7. insert into t1 () values ();        -- Testing default values
  8. insert into t1 values (1,1),(2,1),(3,1);
  9. update t1 set a=4 where b=1 limit 1;
  10. select * from t1;
  11. update t1 set b=2 where b=1 limit 2;
  12. select * from t1;
  13. update t1 set b=4 where b=1;
  14. select * from t1;
  15. delete from t1 where b=2 limit 1;
  16. select * from t1;
  17. delete from t1 limit 1;
  18. select * from t1;
  19. drop table t1;
  20.  
  21. create table t1 (i int);
  22. insert into t1 (i) values(1);
  23. insert into t1 (i) values(1);
  24. insert into t1 (i) values(1);
  25. delete from t1 limit 1;
  26. update t1 set i=2 limit 1;
  27. delete from t1 limit 0;
  28. update t1 set i=3 limit 0;
  29. select * from t1;
  30. drop table t1;
  31.